package com.jingtai.shop.controller.goods;

import com.jingtai.common.template.ResultMapInfo;
import com.jingtai.core.entity.shop.ShufflingFigure;
import com.jingtai.core.template.BaseController;
import com.jingtai.shop.service.goods.ShufflingFigureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * @author GR
 */
@Api(tags = "商城-轮播图")
@RestController
@RequestMapping("/shop/carousel")
@CrossOrigin(origins = "*")
public class CarouselController extends BaseController {

    @Resource
    private ShufflingFigureService figureService;

    /**
     * 首页查询轮播图列表
     */
    @ApiOperation(value = "首页查询轮播图列表")
    @PostMapping("/listShufflingFigure")
    public Map<String, Object> listShufflingFigure() {
        List<ShufflingFigure> shufflingFigures = figureService.listShufflingFigure();
        return returnResultMap(ResultMapInfo.GETSUCCESS, shufflingFigures);
    }

}
